<template>
  <div class="system-backup-container">
    <div class="page-header">
      <h1>系统备份</h1>
      <p>系统数据备份与恢复管理</p>
    </div>
    
    <div class="backup-content">
      <el-card class="backup-card">
        <template #header>
          <div class="card-header">
            <span>备份管理</span>
            <el-button type="primary" @click="createBackup">
              <i class="fa fa-plus"></i>
              创建备份
            </el-button>
          </div>
        </template>
        
        <div class="backup-list">
          <el-table :data="backupList" style="width: 100%">
            <el-table-column prop="name" label="备份名称" />
            <el-table-column prop="size" label="文件大小" />
            <el-table-column prop="created_at" label="创建时间" />
            <el-table-column label="操作">
              <template #default="scope">
                <el-button size="small" @click="downloadBackup(scope.row)">
                  下载
                </el-button>
                <el-button size="small" type="danger" @click="deleteBackup(scope.row)">
                  删除
                </el-button>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </el-card>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { ElMessage } from 'element-plus'

const backupList = ref([])

const createBackup = () => {
  ElMessage.info('备份功能开发中...')
}

const downloadBackup = (backup: any) => {
  ElMessage.info('下载功能开发中...')
}

const deleteBackup = (backup: any) => {
  ElMessage.info('删除功能开发中...')
}

onMounted(() => {
  // 加载备份列表
})
</script>

<style scoped lang="scss">
.system-backup-container {
  padding: 20px;
  background: linear-gradient(135deg, 
    rgba(0, 0, 0, 0.9) 0%, 
    rgba(20, 20, 40, 0.95) 50%, 
    rgba(0, 0, 0, 0.9) 100%
  );
  min-height: 100vh;
  position: relative;

  &::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
      radial-gradient(circle at 20% 80%, rgba(164, 244, 186, 0.1) 0%, transparent 50%),
      radial-gradient(circle at 80% 20%, rgba(164, 244, 186, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
  }
}

.page-header {
  text-align: center;
  margin-bottom: 30px;
  
  h1 {
    color: #a4f4ba;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(164, 244, 186, 0.5);
  }
  
  p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
  }
}

.backup-content {
  max-width: 1200px;
  margin: 0 auto;
}

.backup-card {
  background: rgba(164, 244, 186, 0.1) !important;
  border: 1px solid rgba(164, 244, 186, 0.3) !important;
  border-radius: 15px !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

  :deep(.el-card__header) {
    background: rgba(164, 244, 186, 0.15) !important;
    border-bottom: 1px solid rgba(164, 244, 186, 0.3) !important;
    border-radius: 15px 15px 0 0 !important;
  }

  :deep(.el-card__body) {
    background: transparent !important;
  }
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  
  span {
    color: #a4f4ba;
    font-size: 1.2rem;
    font-weight: bold;
  }
}

:deep(.el-table) {
  background: transparent !important;
  
  .el-table__header {
    background: rgba(164, 244, 186, 0.1) !important;
    
    th {
      background: transparent !important;
      color: #a4f4ba !important;
      border-bottom: 1px solid rgba(164, 244, 186, 0.3) !important;
    }
  }
  
  .el-table__body {
    tr {
      background: transparent !important;
      
      &:hover {
        background: rgba(164, 244, 186, 0.1) !important;
      }
      
      td {
        background: transparent !important;
        color: rgba(255, 255, 255, 0.9) !important;
        border-bottom: 1px solid rgba(164, 244, 186, 0.2) !important;
      }
    }
  }
}

:deep(.el-button) {
  background: rgba(164, 244, 186, 0.2) !important;
  border: 1px solid rgba(164, 244, 186, 0.5) !important;
  color: #a4f4ba !important;
  
  &:hover {
    background: rgba(164, 244, 186, 0.3) !important;
    border-color: rgba(164, 244, 186, 0.7) !important;
  }
  
  &.el-button--primary {
    background: rgba(164, 244, 186, 0.3) !important;
    border-color: rgba(164, 244, 186, 0.6) !important;
  }
  
  &.el-button--danger {
    background: rgba(255, 99, 99, 0.2) !important;
    border-color: rgba(255, 99, 99, 0.5) !important;
    color: #ff6363 !important;
    
    &:hover {
      background: rgba(255, 99, 99, 0.3) !important;
    }
  }
}
</style>
